package com.ruoyi.course.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.course.domain.SelectCourse;
import com.ruoyi.course.service.ICourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: @Weiney
 * @ClassName: MyCourseTableController
 * @Description: 我的课程表Controller
 * @Create: 2025-02-25
 **/

@RestController
@RequestMapping("/course/myCourseTable")
public class MyCourseTableController extends BaseController {

    @Autowired
    private ICourseService courseService;

    /**
     * 获取课程表列表
     */
    @PreAuthorize("@ss.hasPermi('course:myCourseTable:query')")
    @GetMapping("/list")
    public AjaxResult getCourseTableList() {
        Long userId = getUserId();
        List<SelectCourse> courseList = courseService.getCourseTableList(userId);
        return success(courseList);
    }
}